//
//  dangeViewController.m
//  xinhua_sx
//
//  Created by love on 14-8-7.
//  Copyright (c) 2014年 dangyangyang. All rights reserved.
//

#import "dangeViewController.h"
#import "dishiViewController.h"
#define WRITH  dispatch_queue_create("com.dispatch.writedb", DISPATCH_QUEUE_SERIAL)



#import "GTMNSString+HTML.h"

#import "AFNetworking.h"
#import "AFHTTPRequestOperation.h"
#import "MJRefresh.h"
#import "UIImageView+AFNetworking.h"
#import "UIImageView+WebCache.h"
#import <MediaPlayer/MediaPlayer.h>
#import "XHURLString.h"
#import "NewsDetailViewController.h"


@interface dangeViewController ()
@property (nonatomic, strong) MJRefreshHeaderView* headerView ;
@property (nonatomic, strong)   MJRefreshFooterView* footerView ;
@end

@implementation dangeViewController
@synthesize allArray;
@synthesize allDIC;
@synthesize tableView = _tableView;
@synthesize newdId;
@synthesize titleString;
@synthesize headerView;
@synthesize footerView;
@synthesize huimingbiaoti;
@synthesize lanmuTitles;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
-(void)rightClick
{
    dishiViewController* viewController = [[dishiViewController alloc] init];
    viewController.block = ^(NSString* str,NSString*fff1)
    {
        NSLog(fff1);
       
        lanmuTitles.text = str;
        if ([fff1 isEqualToString:areaCode])
        {
            NSLog(@"frff= %@",fff1);
            
        }
        else
        {
            NSLog(@"333 = %@",fff1);
            areaCode = fff1;
            [self reshrg];

        }
        //NSLog(@"%@ = %@",fff1,areaCode);
    };
    if ([titleString isEqualToString:@"地市"])
    {
        viewController.s1tring = @"只显示地市";
    }
    [self presentViewController:viewController animated:YES completion:nil];
}
-(void)reshrg
{
    [[AFHTTPRequestOperationManager manager].operationQueue cancelAllOperations];
    //self.allDIC = nil;
    [self.allDIC removeAllObjects];
   // self.allDIC
     //[headerView beginRefreshing];
    [self.tableView reloadData];
    dispatch_queue_t curQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
    dispatch_async(curQueue, ^{
        isRefresh = YES;
        [self loadNews:@"0"page:@"0" pageSize:@"10"];
    });

    NSLog(@"reshrg");
}

-(void)areaCodeinit
{
    if ([titleString isEqualToString:@"县区"] || [titleString isEqualToString:@"政务大厅"] || [titleString isEqualToString:@"通知公告"] || [titleString isEqualToString:@"政务动态"])
    {
        areaCode =COUTURYCODE;// [self getAREACODe:nil];
    }
    else if ([titleString isEqualToString: @"地市"])
    {
        areaCode = CITYCODE;// [self getAREACODe:CITYNAME];//复制时替换成 地市
    }
    else if ([titleString isEqualToString: @"山西省"] )
    {
        areaCode = @"140000";
    }
    else if ([titleString isEqualToString:@"全国"])
    {
         areaCode = @"100000";
    }
    else if ([titleString isEqualToString:@"惠民生活"] )
    {
        areaCode = COUTURYCODE;// [self getAREACODe:nil];
    }
    else if ([titleString isEqualToString:@"办事指南"])
    {
        areaCode = @"140000";
    }
  
    
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    allDIC = [NSMutableDictionary dictionary];
    allArray = [NSMutableArray array];
    [self areaCodeinit];
    CGFloat aY = kIOS_VERSION<7.0?0:20;
    UIView* _navBar = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.frame.size.width, 44.0+aY)];
    _navBar.backgroundColor = [UIColor colorWithRed:2.0/255 green:102.0/255 blue:172.0/255 alpha:1.0];
    _navBar.userInteractionEnabled = YES;
    
    UILabel* _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, aY, self.view.frame.size.width, 44)];
    _titleLable.backgroundColor = [UIColor clearColor];
    _titleLable.textColor = [UIColor whiteColor];
    _titleLable.font = [UIFont systemFontOfSize:20];
    _titleLable.textAlignment = NSTextAlignmentCenter;
    _titleLable.text = titleString;
    if ([huimingbiaoti length] > 0)
    {
        _titleLable.text = huimingbiaoti;
    }
    [_navBar addSubview:_titleLable];
    [self.view addSubview:_navBar];
    
    lanmuTitles = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.size.width-100, 5+aY, 60, 40)];
    lanmuTitles.backgroundColor = [UIColor clearColor];
    lanmuTitles.font = [UIFont systemFontOfSize:12];
    lanmuTitles.textColor = [UIColor whiteColor];
    [self.view addSubview:lanmuTitles];
    lanmuTitles.text = COUTURYNAME;//复制时替换成 县区
    if ([titleString isEqualToString:@"全国"] || [titleString isEqualToString:@"山西省"] || [titleString isEqualToString:@"要闻推荐"]||[titleString isEqualToString:@"办事指南"]||[titleString isEqualToString:@"本地新闻"])
    {
        lanmuTitles.hidden =YES;
    }
    else
    {
        UIButton* _rightButton = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width-60, 5+aY, 40, 40)];
        [_rightButton setImage:[UIImage imageNamed:@"tab_spinner_normal.png"] forState:UIControlStateNormal];
        [_rightButton addTarget:self action:@selector(rightClick) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:_rightButton];
    }
    if ([titleString isEqualToString:@"地市"])
    {
        lanmuTitles.text = CITYNAME; //复制时替换成 地市
    }
    else
    {
        lanmuTitles.text = COUTURYNAME;//复制时替换成 县区
    }
    UIButton* _leftButton = [[UIButton alloc] initWithFrame:CGRectMake(0, aY, 40,40.0)];
    [_leftButton setImage:[UIImage imageNamed:@"icon_back@2x.png"] forState:UIControlStateNormal];
    
    _leftButton.imageEdgeInsets = UIEdgeInsetsMake(10, 13, 5, 5);
    [_leftButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_leftButton];
    
    UITableView* tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 44+aY, 320, self.view.frame.size.height-80-10)];
    tableView.delegate = self;
    tableView.dataSource = self;
   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(gmModelNoticicationCenterMethod) name:@"modelNCOne1" object:Nil];
    //tableView.bounces = NO;;
    
     headerView = [MJRefreshHeaderView header];
     footerView = [MJRefreshFooterView footer];
     headerView.delegate = self;
    footerView.delegate = self;

    [self setExtraCellLineHidden:tableView];
    
    headerView.scrollView = tableView;
    footerView.scrollView = tableView;
    NSDate * now = [NSDate date];
    NSDate * anHourAgo = [now dateByAddingTimeInterval:-60*5];
    [headerView setLastUpdateTime:anHourAgo];
    [self.view addSubview:tableView];
    self.tableView = tableView;
    //self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
    [headerView beginRefreshing];
    // Do any additional setup after loading the view.
}
-(void)gmModelNoticicationCenterMethod{
    
   
    
    [self gmTransferDataToTableView];
    
    
    
    
    //使用其它线程对数据存档
    if(self.allDIC){
        dispatch_queue_t curQueueFour = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
        dispatch_async(curQueueFour, ^{
            
        });
    }
    
    
}
- (void)setExtraCellLineHidden: (UITableView *)tableView{
    UIView *view =[ [UIView alloc]init];
    view.backgroundColor = [UIColor clearColor];
    [tableView setTableFooterView:view];
    [tableView setTableHeaderView:view];
  
}
-(void)gmTransferDataToTableView{
    
    dispatch_queue_t curQueueTwo = dispatch_get_main_queue();
    
    dispatch_async(curQueueTwo, ^{
        
        [self.tableView reloadData];
        [headerView endRefreshing];
        [footerView endRefreshing];
    });
}

-(void)gmRequestNetData{
    
    dispatch_queue_t curQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
    dispatch_async(curQueue, ^{
        
        [self loadNews:@"0"page:@"0" pageSize:@"10"];
    });
    
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if ([[[self.allDIC objectForKey:@"dic"] objectForKey:@"content"] count] == 0)
    {
        tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
    else
    {
         tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
    }
    return [[[self.allDIC objectForKey:@"dic"] objectForKey:@"content"] count];
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    customTablViewCell1* cell = [tableView dequeueReusableCellWithIdentifier:@"1"];
    
    if (cell == nil)
    {
        cell = [[customTablViewCell1 alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"1"];
    }
    
    [cell setDic:[[[self.allDIC objectForKey:@"dic"]  objectForKey:@"content"]objectAtIndex:indexPath.row] tag:tableView.tag];
            //NSString* title = [[[[self.allNewDic objectForKey:[self.titleArray objectAtIndex:i]] objectForKey:@"content"] objectAtIndex:indexPath.row] objectForKey:@"artTitle"];
    //cell.selectionStyle = UITableViewCellSelectionStyleNone;
    //tableView.separatorStyle = UITableViewCellSelectionStyleGray;
    return cell;
}
-(void)dealloc
{
    NSLog(@"dealloc");
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"modelNCOne1" object:Nil];
    [headerView free];
    [footerView free];
    
}

-(NSString*)retuntrURls :(NSString*)page  code:(NSString*)acode pagesize:(NSString*)pagesize
{
    NSString* string;
    if ([titleString isEqualToString:@"领导之窗"] || [titleString isEqualToString:@"通知公告"] || [titleString isEqualToString:@"政务大厅"] )
    {
        
    }
    string = [NSString stringWithFormat:@"http://183.203.18.45:7001/xinhua/m/articles-list-%@-%@.html?pageNo=%@&pageSize=%@",newdId,areaCode,page,pagesize];
    if ([titleString isEqualToString:@"要闻推荐"])
    {
        string = [NSString stringWithFormat:@"http://183.203.18.45:7001/xinhua/m/article-news.html?pageNo=%@&pageSize=%@",page,pagesize];
    }
    if ([titleString isEqualToString:@"本地新闻"])
    {
        string = [NSString stringWithFormat:@"http://183.203.18.45:7001/xinhua/m/articles-list-8-%@.html?pageNo=%@&pageSize=%@",COUTURYCODE,page,pagesize];
    }
    return string;
    
}
-(void)loadNews:(NSString*)i page:(NSString*)j pageSize:(NSString*)k
{
    
   
  
    NSString* str = [self retuntrURls:j code:areaCode pagesize:k];
    NSLog(@"rtl = %@",str);
    BOOL ishgg = isRefresh;
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
    
    [manager GET:str parameters:nil success:^(AFHTTPRequestOperation*operation, id responseObject) {
        id jsonObject = [NSJSONSerialization JSONObjectWithData:operation.responseData
                                                        options:NSJSONReadingAllowFragments
                                                          error:nil];
        NSLog(@"json =- %@",jsonObject);
        // //NSLog([@"COUNT = %lu",(unsigned long)[jsonObject count]);
        NSArray* array = [jsonObject objectForKey:@"content"];
        NSLog(@"array = %d",[array count]);
        dispatch_async(WRITH, ^{
            if (ishgg)
            {
                //NSLog([@" %@写入 page = %@ 刷新",[self.titleArray objectAtIndex:i],j);
                ////NSLog([@"%@ is ",[self.titleArray objectAtIndex:i]);
                
                NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:array,@"content",[jsonObject objectForKey:@"last"],@"last",[jsonObject objectForKey:@"currentPage"],@"currentPage", nil];
                [self.allDIC removeObjectForKey:@"dic"];
                [self.allDIC setObject:dic forKey:@"dic"];
                
            }
            else{
                //NSLog([@" %@写入 更多",[self.titleArray objectAtIndex:i]);
                
                
                NSMutableArray* oldContentArray = [[NSMutableArray alloc] init];
                [oldContentArray addObjectsFromArray:[[self.allDIC objectForKey:@"dic"] objectForKey:@"content"]];
                [oldContentArray addObjectsFromArray:array];
                
                NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:oldContentArray,@"content",[jsonObject objectForKey:@"last"],@"last",[jsonObject objectForKey:@"currentPage"],@"currentPage", nil];
                
                [self.allDIC removeObjectForKey:@"dic"];
                [self.allDIC setObject:dic forKey:@"dic"];
                
                
            }
            //[self performSelector:@selector(doneWithView:) withObject:_BseVIes afterDelay:0.0];
            //NSLog([@" %@写入 page = %@ 完成",[self.titleArray objectAtIndex:i],j);
            NSNotification *endData = [NSNotification notificationWithName:@"modelNCOne1" object:nil userInfo:nil];
            [[NSNotificationCenter defaultCenter] postNotification:endData];
            
        });
        //[self performSelector:@selector(fff:) withObject:i afterDelay:2.0];
        
        
    } failure:^(AFHTTPRequestOperation *operation, NSError*error) {
        NSLog(@"Error: %@", error);
        
        [headerView  endRefreshing];
        [footerView endRefreshing];
    }];
    
    
    
    
    
    
    
}
-(void)back
{
   [[NSNotificationCenter defaultCenter] removeObserver:self name:@"modelNCOne1" object:Nil];
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - 刷新控件的代理方法
#pragma mark 开始进入刷新状态
- (void)refreshViewBeginRefreshing:(MJRefreshBaseView *)refreshView
{
    NSLog(@"22222");
    // //NSLog(@%@----开始进入刷新状态, refreshView.class);
    // 2.2秒后刷新表格UI
    //[self performSelector:@selector(doneWithView:) withObject:refreshView afterDelay:2.0];
    //NSLog([@"retag =%d",refreshView.tag);
    if ([refreshView.class isSubclassOfClass:[MJRefreshHeaderView class]])
    {
        NSLog(@"222");
            isRefresh = YES;
            [self gmRequestNetData];
        
        
    }
    else if ([refreshView.class isSubclassOfClass:[MJRefreshFooterView class]])

    {        isRefresh = NO;
        
                
                NSString* countPage =  [[self.allDIC objectForKey:@"dic"] objectForKey:@"last"];
                NSUInteger couf =  [[[self.allDIC objectForKey:@"dic"] objectForKey:@"content"] count];
                NSLog(@" a = %d, b= %u",couf/10, [countPage intValue]);
                if (couf%10 != 0)
                {
                    [refreshView endRefreshing];
                    return;
                }
                if ( couf/10 >= [countPage intValue] )
                {
                    [refreshView endRefreshing];
                    return;
                }
                
                NSString* st = [NSString stringWithFormat:@"%d",couf/10 +1] ;
                
                dispatch_queue_t curQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
                dispatch_async(curQueue, ^{
                    
                    [self loadNews:@"0" page:st pageSize:@"10"];
                });
                
        }
    
    
}



#pragma mark 刷新完毕
- (void)refreshViewEndRefreshing:(MJRefreshBaseView *)refreshView
{
    ////NSLog(@%@----刷新完毕, refreshView.class);
}

#pragma mark 监听刷新状态的改变
- (void)refreshView:(MJRefreshBaseView *)refreshView stateChange:(MJRefreshState)state
{
    switch (state) {
        case MJRefreshStateNormal:
            // //NSLog(@%@----切换到：普通状态, refreshView.class);
            break;
            
        case MJRefreshStatePulling:
            // //NSLog(@%@----切换到：松开即可刷新的状态, refreshView.class);
            break;
            
        case MJRefreshStateRefreshing:
            // //NSLog(@%@----切换到：正在刷新状态, refreshView.class);
            break;
        default:
            break;
    }
}

#pragma mark 刷新表格并且结束正在刷新状态
- (void)doneWithView:(MJRefreshBaseView *)refreshView
{
    // 刷新表格
    //[myTableView reloadData];
    
    // (最好在刷新表格后调用)调用endRefreshing可以结束刷新状态
    //[self.tableView reloadData];
    [refreshView endRefreshing];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    //清除缓存：
    [[SDImageCache sharedImageCache] clearDisk];
    
    [[SDImageCache sharedImageCache] clearMemory];
    // Dispose of any resources that can be recreated.
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    NSString* sting = [[[[self.allDIC objectForKey:@"dic"] objectForKey:@"content"] objectAtIndex:indexPath.row] objectForKey:@"link"];
    if([sting length] > 0)
    {
        
        NSString* s = [NSString stringWithFormat:@"http://183.203.18.45:7001%@",sting];
        MPMoviePlayerViewController *playerViewController =[[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:s]];
        NSNotificationCenter* notificationCenter = [NSNotificationCenter defaultCenter];
        [notificationCenter addObserver:self
                               selector:@selector(moviePlayerPreloadDidFinish:)
                                   name:
         MPMediaPlaybackIsPreparedToPlayDidChangeNotification
                                 object:playerViewController];
        [playerViewController.moviePlayer play];
        [self presentMoviePlayerViewControllerAnimated:playerViewController];
    }
    else
    {
        NSNumber* newsId = [[[[self.allDIC objectForKey:@"dic"] objectForKey:@"content"] objectAtIndex:indexPath.row] objectForKey:@"id"];
        NSString* imageString = [[[[self.allDIC objectForKey:@"dic"] objectForKey:@"content"] objectAtIndex:indexPath.row] objectForKey:@"image"];
           NewsDetailViewController *newsDetailViewController = [[NewsDetailViewController alloc] initWithNewsId:newsId];
        if ([imageString length] > 0 && ![imageString isEqualToString:@"null"])
        {
            if([imageString hasPrefix:@"http"])
            {
                
                newsDetailViewController.imageString =  [NSString stringWithFormat:@"%@",imageString];
                
            
            }
            else
            {
                newsDetailViewController.imageString = [NSString stringWithFormat:@"http://183.203.18.45:7001%@",imageString];
             
            }
            
        }
        NSLog(@"imagest = %@",newsDetailViewController.imageString);
        newsDetailViewController.fefncode = areaCode;
        [self.navigationController pushViewController:newsDetailViewController animated:YES];
    }

}
-(void)moviePlayerPreloadDidFinish:(id)sender

{
    
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 100;
}
/*
-(NSString*)getAREACODe:(NSString*)address
{
    if([@"太原" isEqualToString:address]){
        return @"140100";
    }
    if([@"大同" isEqualToString:address]){
        return @"037000";
    }
    if([@"阳泉" isEqualToString:address]){
        return @"045000";
    }
    if([@"长治" isEqualToString:address]){
        return @"046001";
    }
    if([@"晋城" isEqualToString:address]){
        return @"048000";
    }
    if([@"朔州" isEqualToString:address]){
        return @"036001";
    }
    if([@"晋中" isEqualToString:address]){
        return @"140700";
    }
    if([@"运城" isEqualToString:address]){
        return @"044000";
    }
    if([@"忻州" isEqualToString:address]){
        return @"034000";
    }
    if([@"临汾" isEqualToString:address]){
        return @"041000";
    }
    if([@"吕梁" isEqualToString:address]){
        return @"033000";
    }
    if([@"小店" isEqualToString:address]){
        return @"140105";
    }
    if([@"古交市" isEqualToString:address]){
        return @"030200";
    }
    if([@"万柏林" isEqualToString:address]){
        return @"030021";
    }
    if([@"晋源" isEqualToString:address]){
        return @"140110";
    }
    if([@"城区" isEqualToString:address]){
        return @"037001";
    }
    if([@"南郊区" isEqualToString:address]){
        return @"037002";
    }
    if([@"浑源" isEqualToString:address]){
        return @"037400";
    }
    if([@"灵丘" isEqualToString:address]){
        return @"034400";
    }
    if([@"阳泉城区" isEqualToString:address]){
        return @"045002";
    }
    if([@"阳泉矿区" isEqualToString:address]){
        return @"045003";
    }
    if([@"阳泉郊区" isEqualToString:address]){
        return @"045001";
    }
    if([@"盂县" isEqualToString:address]){
        return @"045100";
    }
    if([@"长治郊区" isEqualToString:address]){
        return @"046002";
    }
    if([@"襄垣" isEqualToString:address]){
        return @"046200";
    }
    if([@"屯留" isEqualToString:address]){
        return @"046100";
    }
    if([@"长子" isEqualToString:address]){
        return @"046600";
    }
    if([@"晋城城区" isEqualToString:address]){
        return @"048002";
    }
    if([@"沁水" isEqualToString:address]){
        return @"048200";
    }
    if([@"阳城" isEqualToString:address]){
        return @"048100";
    }
    if([@"泽州" isEqualToString:address]){
        return @"048001";
    }
    if([@"朔城区" isEqualToString:address]){
        return @"036002";
    }
    if([@"山阴" isEqualToString:address]){
        return @"036900";
    }
    if([@"怀仁" isEqualToString:address]){
        return @"038300";
    }
    if([@"和顺" isEqualToString:address]){
        return @"032700";
    }
    if([@"寿阳" isEqualToString:address]){
        return @"140725";
    }
    if([@"平遥" isEqualToString:address]){
        return @"031100";
    }
    if([@"灵石" isEqualToString:address]){
        return @"031301";
    }
    if([@"盐湖区" isEqualToString:address]){
        return @"044001";
    }
    if([@"永济" isEqualToString:address]){
        return @"044500";
    }
    if([@"河津" isEqualToString:address]){
        return @"043300";
    }
    if([@"忻府区" isEqualToString:address]){
        return @"034001";
    }
    if([@"定襄" isEqualToString:address]){
        return @"335400";
    }
    if([@"五台" isEqualToString:address]){
        return @"335500";
    }
    if([@"代县" isEqualToString:address]){
        return @"034200";
    }
    if([@"原平" isEqualToString:address]){
        return @"034100";
    }
    if([@"尧都区" isEqualToString:address]){
        return @"041002";
    }
    if([@"洪洞" isEqualToString:address]){
        return @"031600";
    }
    if([@"安泽" isEqualToString:address]){
        return @"042500";
    }
    if([@"离石区" isEqualToString:address]){
        return @"033099";
    }
    if([@"柳林" isEqualToString:address]){
        return @"033300";
    }
    if([@"交口" isEqualToString:address]){
        return @"032499";
    }
    if([@"孝义" isEqualToString:address]){
        return @"032300";
    }
    if([@"静乐" isEqualToString:address]){
        return @"035100";
    }
    return COUTURYCODE; //复制时替换成 县区Code
    
}
*/
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
